import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [vue()],
  css: {
    preprocessorOptions: {
      less: {
        charset: false,
        additionalData: '@import "./src/global.less";',
      },
    },
  },
  server:{
      host: '0.0.0.0',
      port: 4000,
      open: true,
      proxy: {
        '/api': {
          target: 'https://zhibo.bohaojy.cn/',   //接口地址
          changeOrigin: true,
          rewrite: (path) => path.replace(/^\/api/, '')
        },
        '/douyin': {
          target: 'https://open.douyin.com/',   //接口地址
          changeOrigin: true,
          rewrite: (path) => path.replace(/^\/douyin/, '')
        },
      }
  }
})
